package com.lovesher.payment.common.enums;

public enum PayStatus {

	INIT(0, "等待支付"), 
	SUCCESS(1, "支付成功"), 
	FAILURE(2, "支付失败");

	private int status;
	private String content;

	private PayStatus(int status, String content) {
		this.status = status;
		this.content = content;
	}

	public int getValue() {
		return this.status;
	}

	public String getContent() {
		return this.content;
	}

	public static PayStatus valueOf(int status) {
		PayStatus ret = null;
		for (PayStatus stt : PayStatus.values()) {
			if (stt.getValue() == status) {
				ret = stt;
				break;
			}
		}
		return ret;
	}

	public static String contentOf(int status) {
		PayStatus ret = null;
		for (PayStatus stt : PayStatus.values()) {
			if (stt.getValue() == status) {
				ret = stt;
				break;
			}
		}
		return ret.getContent();
	}
}
